package com.lyc.dao;

import com.lyc.dao.imp.CountryInfoDAOImpl;
import com.lyc.entity.CountryInfo;
import org.junit.jupiter.api.Test;

import java.sql.SQLException;

/**
 * @Program: medal
 * @Author: YC
 * @Date: 2022/5/5 18:56
 */

public class CountryInfoDAOTest {
    private CountryInfoDAO dao = new CountryInfoDAOImpl();

    @Test
    public void insert() throws SQLException{
        dao.insert(new CountryInfo("cn","中华人民共和国","China","中国"," "));
    }

    @Test
    public void select() throws SQLException{
        System.out.println(dao.select(0,1));
        System.out.println(dao.selectById("cn"));
    }

    @Test
    public void updateById() throws SQLException{
        dao.updateById(new CountryInfo("cn","中华人民共和国1","China","中国"," "));
    }

    @Test
    public void deleteById() throws SQLException{
        dao.deleteById("cn");
    }
}
